package com.guchenbo.spark.core

import org.apache.spark.{SparkConf, SparkContext}

/**
 * @author guchenbo
 * @date 2022/3/2
 */
object SparkUtils {

  def conf(appName: String, master: String = "local[*]"): SparkConf = {
    new SparkConf().setMaster(master).setAppName(appName)
  }

  def sc(appName: String, master: String = "local[*]"): SparkContext = {
    new SparkContext(conf(appName, master))
  }
}
